package com.platform.controller.backend;

import com.github.pagehelper.PageInfo;
import com.platform.base.BaseController;
import com.platform.common.Const;
import com.platform.common.ServerResponse;

import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 角色控制层
 */
@RestController
@RequestMapping("/roleController/")
@CrossOrigin(origins = Const.REQUESTURL,maxAge = 3600,allowCredentials = "true")
public class RoleController extends BaseController {

    @PostMapping(value = "add.do")
    public ServerResponse<String> addRole(@RequestParam Map paramMap){
        return iRoleService.insert(paramMap);
    }

    @PostMapping(value = "del.do")
    public ServerResponse<String> delRole(Integer id){
        return iRoleService.del(id);
    }

    @GetMapping(value = "selectByParam.do")
    public ServerResponse<PageInfo> selectByParam(@RequestParam Map param){
        return iRoleService.selectByParam(param);
    }

    @PostMapping(value = "update.do")
    public ServerResponse<String> update(@RequestParam Map paramMap){
        return iRoleService.update(paramMap);
    }
}
